tooltip: Use gdk_rectangle_contains_point
authorTimm Bäder <mail@baedert.org>
Fri, 18 Jan 2019 08:28:03 +0000 (09:28 +0100)
committerTimm Bäder <mail@baedert.org>
Fri, 18 Jan 2019 18:43:52 +0000 (19:43 +0100)
gtk/gtktooltip.c

index 42f550c24e6b94e364a53dc0bd2bef644329a1e3..07f535ada5de72ab764dd203d1918debbda8486e 100644 (file)
@@ -944,7 +944,7 @@ gtk_tooltip_handle_event_internal (GdkEventType   event_type,
        if (current_tooltip)
          {
            gboolean tip_area_set;
-           GdkRectangle tip_area;
+            GdkRectangle tip_area;
            gboolean hide_tooltip;
 
            tip_area_set = current_tooltip->tip_area_set;
@@ -963,10 +963,7 @@ gtk_tooltip_handle_event_internal (GdkEventType   event_type,
 
            /* Did the pointer move out of the previous "context area"? */
            if (tip_area_set)
-             hide_tooltip |= (x <= tip_area.x
-                              || x >= tip_area.x + tip_area.width
-                              || y <= tip_area.y
-                              || y >= tip_area.y + tip_area.height);
+             hide_tooltip |= !gdk_rectangle_contains_point (&tip_area, x, y);
 
            if (hide_tooltip)
              gtk_tooltip_hide_tooltip (current_tooltip);